{"ast":null,"code":"import classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport AnchorContext from './context';\nconst AnchorLink = props => {\n  const {\n    href = '#',\n    title,\n    prefixCls: customizePrefixCls,\n    children,\n    className,\n    target\n  } = props;\n  const context = React.useContext(AnchorContext);\n  const {\n    registerLink,\n    unregisterLink,\n    scrollTo,\n    onClick,\n    activeLink\n  } = context || {};\n  React.useEffect(() => {\n    registerLink === null || registerLink === void 0 ? void 0 : registerLink(href);\n    return () => {\n      unregisterLink === null || unregisterLink === void 0 ? void 0 : unregisterLink(href);\n    };\n  }, [href, registerLink, unregisterLink]);\n  const handleClick = e => {\n    onClick === null || onClick === void 0 ? void 0 : onClick(e, {\n      title,\n      href\n    });\n    scrollTo === null || scrollTo === void 0 ? void 0 : scrollTo(href);\n  };\n  const {\n    getPrefixCls\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('anchor', customizePrefixCls);\n  const wrapperClassName = classNames(`${prefixCls}-link`, className, {\n    [`${prefixCls}-link-active`]: activeLink === href\n  });\n  const titleClassName = classNames(`${prefixCls}-link-title`, {\n    [`${prefixCls}-link-title-active`]: activeLink === href\n  });\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: wrapperClassName\n  }, /*#__PURE__*/React.createElement(\"a\", {\n    className: titleClassName,\n    href: href,\n    title: typeof title === 'string' ? title : '',\n    target: target,\n    onClick: handleClick\n  }, title), children);\n};\nexport default AnchorLink;","map":{"version":3,"names":["classNames","React","ConfigContext","AnchorContext","AnchorLink","props","href","title","prefixCls","customizePrefixCls","children","className","target","context","useContext","registerLink","unregisterLink","scrollTo","onClick","activeLink","useEffect","handleClick","e","getPrefixCls","wrapperClassName","titleClassName","createElement"],"sources":["/data/messenger.client/node_modules/antd/es/anchor/AnchorLink.js"],"sourcesContent":["import classNames from 'classnames';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport AnchorContext from './context';\nconst AnchorLink = props => {\n  const {\n    href = '#',\n    title,\n    prefixCls: customizePrefixCls,\n    children,\n    className,\n    target\n  } = props;\n  const context = React.useContext(AnchorContext);\n  const {\n    registerLink,\n    unregisterLink,\n    scrollTo,\n    onClick,\n    activeLink\n  } = context || {};\n  React.useEffect(() => {\n    registerLink === null || registerLink === void 0 ? void 0 : registerLink(href);\n    return () => {\n      unregisterLink === null || unregisterLink === void 0 ? void 0 : unregisterLink(href);\n    };\n  }, [href, registerLink, unregisterLink]);\n  const handleClick = e => {\n    onClick === null || onClick === void 0 ? void 0 : onClick(e, {\n      title,\n      href\n    });\n    scrollTo === null || scrollTo === void 0 ? void 0 : scrollTo(href);\n  };\n  const {\n    getPrefixCls\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('anchor', customizePrefixCls);\n  const wrapperClassName = classNames(`${prefixCls}-link`, className, {\n    [`${prefixCls}-link-active`]: activeLink === href\n  });\n  const titleClassName = classNames(`${prefixCls}-link-title`, {\n    [`${prefixCls}-link-title-active`]: activeLink === href\n  });\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: wrapperClassName\n  }, /*#__PURE__*/React.createElement(\"a\", {\n    className: titleClassName,\n    href: href,\n    title: typeof title === 'string' ? title : '',\n    target: target,\n    onClick: handleClick\n  }, title), children);\n};\nexport default AnchorLink;"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,aAAa,MAAM,WAAW;AACrC,MAAMC,UAAU,GAAGC,KAAK,IAAI;EAC1B,MAAM;IACJC,IAAI,GAAG,GAAG;IACVC,KAAK;IACLC,SAAS,EAAEC,kBAAkB;IAC7BC,QAAQ;IACRC,SAAS;IACTC;EACF,CAAC,GAAGP,KAAK;EACT,MAAMQ,OAAO,GAAGZ,KAAK,CAACa,UAAU,CAACX,aAAa,CAAC;EAC/C,MAAM;IACJY,YAAY;IACZC,cAAc;IACdC,QAAQ;IACRC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